<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MQTT C Client Libraries Internals: MQTTVersion.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="pahologo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MQTT C Client Libraries Internals
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">MQTTVersion.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>MQTTVersion - display the version and build information strings for a library.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stdio.h&gt;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &lt;errno.h&gt;</code><br />
<code>#include &lt;fcntl.h&gt;</code><br />
<code>#include &lt;sys/types.h&gt;</code><br />
<code>#include &lt;ctype.h&gt;</code><br />
<code>#include &quot;MQTTAsync.h&quot;</code><br />
<code>#include &lt;dlfcn.h&gt;</code><br />
<code>#include &lt;sys/mman.h&gt;</code><br />
<code>#include &lt;unistd.h&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for MQTTVersion.c:</div>
<div class="dyncontent">
<div class="center"><img src="MQTTVersion_8c__incl.png" border="0" usemap="#aMQTTVersion_8c" alt=""/></div>
<map name="aMQTTVersion_8c" id="aMQTTVersion_8c">
<area shape="rect" title="MQTTVersion &#45; display the version and build information strings for a library." alt="" coords="371,5,484,32"/>
<area shape="rect" title=" " alt="" coords="5,80,65,107"/>
<area shape="rect" title=" " alt="" coords="89,80,152,107"/>
<area shape="rect" title=" " alt="" coords="177,80,241,107"/>
<area shape="rect" title=" " alt="" coords="265,80,326,107"/>
<area shape="rect" title=" " alt="" coords="351,80,408,107"/>
<area shape="rect" title=" " alt="" coords="432,80,519,107"/>
<area shape="rect" title=" " alt="" coords="543,80,605,107"/>
<area shape="rect" title=" " alt="" coords="629,80,689,107"/>
<area shape="rect" title=" " alt="" coords="713,80,805,107"/>
<area shape="rect" title=" " alt="" coords="830,80,897,107"/>
</map>
</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a25f003de16c08a4888b69f619d70f427"><td class="memItemLeft" align="right" valign="top"><a id="a25f003de16c08a4888b69f619d70f427"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>ARRAY_SIZE</b>(a)&#160;&#160;&#160;(sizeof(a) / sizeof(a[0]))</td></tr>
<tr class="separator:a25f003de16c08a4888b69f619d70f427"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a03af212f14771e3a937b54f0b82b5528"><td class="memItemLeft" align="right" valign="top"><a id="a03af212f14771e3a937b54f0b82b5528"></a>
typedef <a class="el" href="structMQTTAsync__nameValue.html">MQTTAsync_nameValue</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><b>func_type</b>) (void)</td></tr>
<tr class="separator:a03af212f14771e3a937b54f0b82b5528"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a60231c316988ddb6d3ecf20a3195fe8d"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTVersion_8c.html#a60231c316988ddb6d3ecf20a3195fe8d">FindString</a> (char *filename, const char *eyecatcher_input)</td></tr>
<tr class="memdesc:a60231c316988ddb6d3ecf20a3195fe8d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds an eyecatcher in a binary file and returns the following value.  <a href="MQTTVersion_8c.html#a60231c316988ddb6d3ecf20a3195fe8d">More...</a><br /></td></tr>
<tr class="separator:a60231c316988ddb6d3ecf20a3195fe8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7a069c25310a625d77a9ed2324e0f5ab"><td class="memItemLeft" align="right" valign="top"><a id="a7a069c25310a625d77a9ed2324e0f5ab"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>printVersionInfo</b> (<a class="el" href="structMQTTAsync__nameValue.html">MQTTAsync_nameValue</a> *info)</td></tr>
<tr class="separator:a7a069c25310a625d77a9ed2324e0f5ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00e897e753d83550bb5094bcb153828a"><td class="memItemLeft" align="right" valign="top"><a id="a00e897e753d83550bb5094bcb153828a"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>loadandcall</b> (const char *libname)</td></tr>
<tr class="separator:a00e897e753d83550bb5094bcb153828a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a889e1ee5b289c4b99cbd5f0ca7e8cbdb"><td class="memItemLeft" align="right" valign="top"><a id="a889e1ee5b289c4b99cbd5f0ca7e8cbdb"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>printEyecatchers</b> (char *filename)</td></tr>
<tr class="separator:a889e1ee5b289c4b99cbd5f0ca7e8cbdb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c04138a5bfe5d72780bb7e82a18e627"><td class="memItemLeft" align="right" valign="top"><a id="a3c04138a5bfe5d72780bb7e82a18e627"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>main</b> (int argc, char **argv)</td></tr>
<tr class="separator:a3c04138a5bfe5d72780bb7e82a18e627"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a79de8d8beaad5d50b6f3c6cff3b574f5"><td class="memItemLeft" align="right" valign="top"><a id="a79de8d8beaad5d50b6f3c6cff3b574f5"></a>
static const char *&#160;</td><td class="memItemRight" valign="bottom"><b>libraries</b> [] = {&quot;paho-mqtt3c&quot;, &quot;paho-mqtt3cs&quot;, &quot;paho-mqtt3a&quot;, &quot;paho-mqtt3as&quot;}</td></tr>
<tr class="separator:a79de8d8beaad5d50b6f3c6cff3b574f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:affd3a14730545c8f212ab574376b0824"><td class="memItemLeft" align="right" valign="top">static const char *&#160;</td><td class="memItemRight" valign="bottom"><b>eyecatchers</b> []</td></tr>
<tr class="separator:affd3a14730545c8f212ab574376b0824"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>MQTTVersion - display the version and build information strings for a library. </p>
<p>With no arguments, we try to load and call the version string for the libraries we know about: mqttv3c, mqttv3cs, mqttv3a, mqttv3as. With an argument: 1) we try to load the named library, call getVersionInfo and display those values. 2) If that doesn't work, we look through the binary for eyecatchers, and display those. <br  />
 This will work if the library is not executable in the current environment. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a60231c316988ddb6d3ecf20a3195fe8d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a60231c316988ddb6d3ecf20a3195fe8d">&#9670;&nbsp;</a></span>FindString()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char * FindString </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>eyecatcher_input</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Finds an eyecatcher in a binary file and returns the following value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filename</td><td>the name of the file </td></tr>
    <tr><td class="paramname">eyecatcher_input</td><td>the eyecatcher string to look for </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the value found - "" if not found </dd></dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="affd3a14730545c8f212ab574376b0824"></a>
<h2 class="memtitle"><span class="permalink"><a href="#affd3a14730545c8f212ab574376b0824">&#9670;&nbsp;</a></span>eyecatchers</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const char* eyecatchers[]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= {<span class="stringliteral">&quot;MQTTAsyncV3_Version&quot;</span>, <span class="stringliteral">&quot;MQTTAsyncV3_Timestamp&quot;</span>,</div>
<div class="line">                                         <span class="stringliteral">&quot;MQTTClientV3_Version&quot;</span>, <span class="stringliteral">&quot;MQTTClientV3_Timestamp&quot;</span>}</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Oct 13 2023 18:02:53 for MQTT C Client Libraries Internals by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
